<?php
/**
 * ListCreativesResultEntry
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Sponsored Brands campaign management
 *
 * Create and manage Sponsored Brands campaigns.   To learn more about Sponsored Brands campaigns, see:   - [Sponsored Brands overview](guides/sponsored-brands/overview)  - [Sponsored Brands campaign structure](guides/sponsored-brands/campaigns/structure)  - [Get started with Sponsored Brands campaigns](guides/sponsored-brands/campaigns/get-started-with-campaigns)
 *
 * OpenAPI spec version: 4.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * ListCreativesResultEntry Class Doc Comment
 *
 * @category Class
 * @description ----------------------------------------------- Structure types ----------------------------------------------- Creative
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class ListCreativesResultEntry implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'ListCreativesResultEntry';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'ad_id' => 'string',
        'creation_time' => 'double',
        'creative_type' => '\AmazonAdvertisingApi\Model\CreativeType',
        'creative_version' => 'string',
        'creative_status' => '\AmazonAdvertisingApi\Model\CreativeStatus',
        'creative_properties' => '\AmazonAdvertisingApi\Model\CreativeProperties',
        'last_update_time' => 'double'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'ad_id' => null,
        'creation_time' => 'double',
        'creative_type' => null,
        'creative_version' => null,
        'creative_status' => null,
        'creative_properties' => null,
        'last_update_time' => 'double'
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'ad_id' => 'adId',
        'creation_time' => 'creationTime',
        'creative_type' => 'creativeType',
        'creative_version' => 'creativeVersion',
        'creative_status' => 'creativeStatus',
        'creative_properties' => 'creativeProperties',
        'last_update_time' => 'lastUpdateTime'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'ad_id' => 'setAdId',
        'creation_time' => 'setCreationTime',
        'creative_type' => 'setCreativeType',
        'creative_version' => 'setCreativeVersion',
        'creative_status' => 'setCreativeStatus',
        'creative_properties' => 'setCreativeProperties',
        'last_update_time' => 'setLastUpdateTime'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'ad_id' => 'getAdId',
        'creation_time' => 'getCreationTime',
        'creative_type' => 'getCreativeType',
        'creative_version' => 'getCreativeVersion',
        'creative_status' => 'getCreativeStatus',
        'creative_properties' => 'getCreativeProperties',
        'last_update_time' => 'getLastUpdateTime'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['ad_id'] = isset($data['ad_id']) ? $data['ad_id'] : null;
        $this->container['creation_time'] = isset($data['creation_time']) ? $data['creation_time'] : null;
        $this->container['creative_type'] = isset($data['creative_type']) ? $data['creative_type'] : null;
        $this->container['creative_version'] = isset($data['creative_version']) ? $data['creative_version'] : null;
        $this->container['creative_status'] = isset($data['creative_status']) ? $data['creative_status'] : null;
        $this->container['creative_properties'] = isset($data['creative_properties']) ? $data['creative_properties'] : null;
        $this->container['last_update_time'] = isset($data['last_update_time']) ? $data['last_update_time'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets ad_id
     *
     * @return string
     */
    public function getAdId()
    {
        return $this->container['ad_id'];
    }

    /**
     * Sets ad_id
     *
     * @param string $ad_id The unique ID of a Sponsored Brands ad.
     *
     * @return $this
     */
    public function setAdId($ad_id)
    {
        $this->container['ad_id'] = $ad_id;

        return $this;
    }

    /**
     * Gets creation_time
     *
     * @return double
     */
    public function getCreationTime()
    {
        return $this->container['creation_time'];
    }

    /**
     * Sets creation_time
     *
     * @param double $creation_time creation_time
     *
     * @return $this
     */
    public function setCreationTime($creation_time)
    {
        $this->container['creation_time'] = $creation_time;

        return $this;
    }

    /**
     * Gets creative_type
     *
     * @return \AmazonAdvertisingApi\Model\CreativeType
     */
    public function getCreativeType()
    {
        return $this->container['creative_type'];
    }

    /**
     * Sets creative_type
     *
     * @param \AmazonAdvertisingApi\Model\CreativeType $creative_type creative_type
     *
     * @return $this
     */
    public function setCreativeType($creative_type)
    {
        $this->container['creative_type'] = $creative_type;

        return $this;
    }

    /**
     * Gets creative_version
     *
     * @return string
     */
    public function getCreativeVersion()
    {
        return $this->container['creative_version'];
    }

    /**
     * Sets creative_version
     *
     * @param string $creative_version The version identifier that helps you keep track of multiple versions of a submitted (non-draft) Sponsored Brands creative.
     *
     * @return $this
     */
    public function setCreativeVersion($creative_version)
    {
        $this->container['creative_version'] = $creative_version;

        return $this;
    }

    /**
     * Gets creative_status
     *
     * @return \AmazonAdvertisingApi\Model\CreativeStatus
     */
    public function getCreativeStatus()
    {
        return $this->container['creative_status'];
    }

    /**
     * Sets creative_status
     *
     * @param \AmazonAdvertisingApi\Model\CreativeStatus $creative_status creative_status
     *
     * @return $this
     */
    public function setCreativeStatus($creative_status)
    {
        $this->container['creative_status'] = $creative_status;

        return $this;
    }

    /**
     * Gets creative_properties
     *
     * @return \AmazonAdvertisingApi\Model\CreativeProperties
     */
    public function getCreativeProperties()
    {
        return $this->container['creative_properties'];
    }

    /**
     * Sets creative_properties
     *
     * @param \AmazonAdvertisingApi\Model\CreativeProperties $creative_properties creative_properties
     *
     * @return $this
     */
    public function setCreativeProperties($creative_properties)
    {
        $this->container['creative_properties'] = $creative_properties;

        return $this;
    }

    /**
     * Gets last_update_time
     *
     * @return double
     */
    public function getLastUpdateTime()
    {
        return $this->container['last_update_time'];
    }

    /**
     * Sets last_update_time
     *
     * @param double $last_update_time last_update_time
     *
     * @return $this
     */
    public function setLastUpdateTime($last_update_time)
    {
        $this->container['last_update_time'] = $last_update_time;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
